﻿package mortal.game.view.blackMarket
{
    import Message.Public.*;
    import flash.utils.*;

    public class BlackMarketCache extends Object
    {
        public var rebateInfoDic:Dictionary;
        public var version:int;

        public function BlackMarketCache()
        {
            this.rebateInfoDic = new Dictionary();
            return;
        }// end function

        public function updateGoodsRemainNum(param1:SOnSellBlackMarketItemsMsg) : void
        {
            var _loc_3:SOnSellBlackMarketItem = null;
            if (this.version != param1.version)
            {
                this.rebateInfoDic = new Dictionary();
                this.version = param1.version;
            }
            var _loc_2:* = param1.items;
            for each (_loc_3 in _loc_2)
            {
                
                if (this.rebateInfoDic[_loc_3.itemCode] == null)
                {
                    this.rebateInfoDic[_loc_3.itemCode] = new BlackMarketData();
                }
                (this.rebateInfoDic[_loc_3.itemCode] as BlackMarketData).remainInfo = _loc_3;
            }
            return;
        }// end function

        public function updatePlayerBuyNum(param1:SOnSellBlackMarketItemsPlayerMsg) : void
        {
            var _loc_3:SOnSellBlackMarketItemPlayer = null;
            if (this.version != param1.version)
            {
                this.rebateInfoDic = new Dictionary();
                this.version = param1.version;
            }
            var _loc_2:* = param1.buyRecords;
            for each (_loc_3 in _loc_2)
            {
                
                if (this.rebateInfoDic[_loc_3.itemCode] == null)
                {
                    this.rebateInfoDic[_loc_3.itemCode] = new BlackMarketData();
                }
                (this.rebateInfoDic[_loc_3.itemCode] as BlackMarketData).playerInfo = _loc_3;
            }
            return;
        }// end function

    }
}
